<?php
// 项目根目录
defined('PROJECT_ROOT')
    || define('PROJECT_ROOT',
              realpath(dirname(dirname(__FILE__))));
 
// 定义到 application 的路径
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH',
              PROJECT_ROOT . '/application');
 
// 定义开发环境
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV',
              (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV')
                                         : 'production'));
 
// Include paths
set_include_path(implode(PATH_SEPARATOR, array(
    PROJECT_ROOT . '/library/'
)));

//date_default_timezone_set('Asia/Shanghai');
// Zend_Application
require_once 'Zend/Application.php';
 
// Create application
$application = new Zend_Application(
    APPLICATION_ENV,
    PROJECT_ROOT . '/library/Edm/Config/Application.ini'
);
 
// 开发环境下打开自动加载警告
if ('production' !== APPLICATION_ENV) {
    $application->getAutoloader()->suppressNotFoundWarnings(false);
}

// 我们仅加载 frontController 资源

$application->getBootstrap()
            ->bootstrap('frontController')
            ->run();

//echo APPLICATION_PATH;